package chapter8;

public class Rectangle {

	int length;
	int width;

	public Rectangle() {
		length = 1;
		width = 1;
	}

	public int perimetro(int length, int width) {
		return length + width;
	}
	
	public int area(int length, int width) {
		return length * width;
	}

	public int getLength() {
		return length;
	}

	public void setLength(int length) {
		if (length > 0 && length < 20) {
			this.length = length;
		} else {
			System.out.println("Erro");
		}
	}

	public int getWidth() {
		return width;
	}

	public void setWidth(int width) {
		if (width > 0 && width < 20) {
			this.width = width;
		} else {
			System.out.println("Erro");
		}
	}

}
